#include <iostream>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <unistd.h>
#include <fcntl.h>

#define FILE_NAME pipe
#define PATH "/home/wmj/pipe1/my_fifo"

class Initpipe{
    public:
    Initpipe(){
        int r = mkfifo(PATH, 0666);
        if(r == -1){
            perror("Create fifo failed!");
        }
    }
    ~Initpipe(){
        int r = unlink(PATH);
        if(r == -1){
            perror("Delete fifo failed!");
        }
    }
};